import PropTypes from 'prop-types';
import { Component } from 'react';

// ui组件
class UiDom extends Component {
    render() {
        const { val, clickName } = this.props;
        return (
            <div>
                <span>我是你的情人：{val}</span>
                <button type="button" onClick={clickName}>
                    点我切换情人
                </button>
            </div>
        );
    }
}
UiDom.propTypes = {
    val: PropTypes.string.isRequired,
    clickName: PropTypes.func.isRequired
};

export default UiDom;
